package com.xsqf.jt808.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.xsqf.jt808.entity.VehicleRegisterInfo;
import com.xsqf.jt808.mapper.VehicleRegisterInfoMapper;
import com.xsqf.jt808.service.IVehicleRegisterInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 *  注册信息
 * @author
 * @since 2020-07-27
 */
@Service
public class VehicleRegisterInfoServiceImpl extends ServiceImpl<VehicleRegisterInfoMapper, VehicleRegisterInfo> implements IVehicleRegisterInfoService {

    @Autowired
    VehicleRegisterInfoMapper registerInfoMapper;

    @Override
    public VehicleRegisterInfo findByTerminalId(String terminalId) {
        QueryWrapper<VehicleRegisterInfo> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("terminal_id",terminalId).eq("deleted","0");
        return registerInfoMapper.selectOne(queryWrapper);
    }

    @Override
    public VehicleRegisterInfo findByLicensePlate(String licensePlate) {
        QueryWrapper<VehicleRegisterInfo> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("license_plate",licensePlate).eq("deleted","0");
        return registerInfoMapper.selectOne(queryWrapper);
    }
}
